{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=254
  Verdict: Accepted
}
var a,b,c,d:longint;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(a,b,c,d);
if (a=c) or (b=d) then write('YES') else write('NO');
end.